<?php


/** ensure this file is being included by a parent file */
defined('_VALID_MOS') or die('Direct Access to this location is not allowed.'); 

/*
 * 
 */
class TableTicket extends HelpDeskTable {
 	 	 	 	 	 	
	var $id						= null;

	var $sender_email 			= null; // varchar(255)
	var $sender_userid 			= null; // int(11)
	var $sender_read_datetime	= null; // date	
	var $sender_flag_read		= null; // int(1)
	
	var $subject				= null; // varchar(255)
	var $description			= null;
	
	var $type					= null; 
	var $entrytype				= null; 
	var $entryid				= null;
	var $target_datetime		= null;	
	var $manager_userid			= null; 
	var $status					= null; 

	var $feedback_by			= null; 
	var $feedback_datetime		= null; 
	var $feedback_rating		= null; 
	var $closed_by				= null;
	var $closed_datetime		= null;
	
	var $created_by				= null;
	var $created_datetime		= null;
	var $last_modified_by		= null;
	var $last_modified_datetime = null;
	var $published				= null;
	var $followup				= null;
	
	var $firstresponse_by			= null;
	var $firstresponse_datetime		= null;

	var $categoryid				= null;
	var $title					= null;
	var $checked_out			= null; 	
	var $checked_out_time		= null; 	
	
	function TableTicket( &$db ) {
		parent::__construct( '#__helpdesk_tickets', 'id', $db );
	}
	
	// check -- only one ticket per transaction
	/** overloaded check function */
	function check() {
		return true;
	}
	
} // end class HelpDeskTicket



/*
 * 
 */
class HelpDeskMessage extends mosDBTable {
 	 	 	 	 	 	
	var $id					= null;
	var $ticketid			= null;
	var $userid_from		= null; // int(11)
	var $username_from		= null; // varchar(255)
	var $subject			= null; // varchar(255)
	var $message			= null; // text
	var $priority			= null; // int(1)
	var $datetime			= null; // date
		
	function HelpDeskMessage( &$db ) {
		$this->mosDBTable( '#__helpdesk_messages', 'id', $db );
	}
} // end class HelpDeskMessage